home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1167 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.9 KB

  1. Subject: disk change crash, more patches
  2. Date: Tue, 8 Mar 94 1:28:10 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4. Message-Id: <9403080028.AA00992@jelal.north.de>
  5.  
  6. another one :)
  7.  
  8. dosfile.c: ++bjarne@goedel.uni-muenster.de
  9.     Make f_open and f_create reentrant.
  10.  
  11.  do a forced disk change (desktop: esc) and it crashes...
  12.  
  13. Index: filesys.c
  14. @@ -391,7 +391,8 @@
  15.      for (p = proclist; p; p = p->gl_next) {
  16.      /* invalidate all open files on this device */
  17.          for (i = MIN_HANDLE; i < MAX_OPEN; i++) {
  18. -            if (((f = p->handle[i]) != 0) && (f->fc.dev == d)) {
  19. +            if (((f = p->handle[i]) != 0) && f != (FILEPTR *)1 &&
  20. +                (f->fc.dev == d)) {
  21.                  if (!warned) {
  22.                  ALERT(
  23.  "Files were open on a changed drive (0x%x)!", d);
  24. Index: dosdir.c
  25. @@ -1318,7 +1318,8 @@
  26.          if (p->wait_q == ZOMBIE_Q || p->wait_q == TSR_Q)
  27.              continue;
  28.          for (i = MIN_HANDLE; i < MAX_OPEN; i++) {
  29. -            if ( ((f = p->handle[i]) != 0) && (f->fc.dev == dev) ) {
  30. +            if ( ((f = p->handle[i]) != 0) && f != (FILEPTR *)1 &&
  31. +                (f->fc.dev == dev) ) {
  32.          DEBUG(("Dlock: process %d has an open handle on the drive", p->pid));
  33.                  if (p->pid == 0) return EACCDN;
  34.                  return (mode & 2) ? p->pid : EACCDN;
  35. Index: dosfile.c
  36. @@ -265,6 +265,7 @@
  37.      long r = 0;
  38.  
  39.      if (!f) return EIHNDL;
  40. +    if (f == (FILEPTR *)1) return 0;
  41.  
  42.  /* if this file is "select'd" by this process, unselect it
  43.   * (this is just in case we were killed by a signal)
  44. Index: proc.c
  45. @@ -142,7 +142,7 @@
  46.  /* copy open handles */
  47.      for (i = MIN_HANDLE; i < MAX_OPEN; i++) {
  48.          if ((f = p->handle[i]) != 0) {
  49. -            if (f->flags & O_NOINHERIT)
  50. +            if (f == (FILEPTR *)1 || f->flags & O_NOINHERIT)
  51.          /* oops, we didn't really want to copy this handle */
  52.                  p->handle[i] = 0;
  53.              else
  54.  
  55.  and another stack thing... (don't use parents user stack here)
  56.  
  57. Index: dosmem.c
  58. @@ -1276,7 +1276,11 @@
  59.              post_sig(p, SIGKILL);    /* then kill it */
  60.              p->ctxt[CURRENT].pc = (long)check_sigs;
  61.                  /* just to make sure it dies */
  62. +            p->ctxt[CURRENT].sr |= 0x2000;
  63. +                /* but do it in super mode */
  64. +#if 0                /* set up in fork_proc() */
  65.              p->ctxt[CURRENT].ssp = (long)(p->stack + ISTKSIZE);
  66. +#endif
  67.              p->pri = MAX_NICE+1;
  68.              run_next(p, 1);
  69.              yield();
  70.  
  71.  these 2 were not necessary i think:
  72.  
  73. Index: dosmem.c
  74. @@ -644,7 +644,6 @@
  75.          /* we guarantee ourselves at least 2 timeslices to do an Mshrink */
  76.              assert(curproc->magic == CTXT_MAGIC);
  77.              fresh_slices(2);
  78. -            spl7();
  79.              leave_kernel();
  80.              change_context(&(curproc->ctxt[CURRENT]));
  81.          }
  82. Index: proc.c
  83. @@ -573,11 +573,10 @@
  84.      curproc->ctxt[CURRENT].regs[0] = 1;
  85.      curproc = p;
  86.      proc_clock = TIME_SLICE;    /* fresh time */
  87. -    assert(p->magic == CTXT_MAGIC);
  88. -    spl7();
  89.      if ((p->ctxt[CURRENT].sr & 0x2000) == 0) {    /* user mode? */
  90.          leave_kernel();
  91.      }
  92. +    assert(p->magic == CTXT_MAGIC);
  93.      change_context(&(p->ctxt[CURRENT]));
  94.      /* not reached */
  95.      return 0;
  96.  
  97. -- 
  98. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  99.                                 ...ohne Gewehr
  100. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  101.